/*
 * @Author: gaoyu gy15354315043@163.com
 * @Date: 2024-10-12 14:47:17
 * @LastEditors: gaoyu gy15354315043@163.com
 * @LastEditTime: 2024-11-11 17:27:53
 * @Description: 
 * Copyright (c) 2024-present HBIS Digital Technology Co.,Ltd. All rights reserved. 
 */
import { default as request, cloud } from '@/framework/utils/request';
import { messageDatal, PlatNoticeType, platMessageListType } from './types';
import { ResultData } from '@/framework/api/common';

/**
 * @description:  小铃铛通知公告
 * @return {*}
 */
export function mySystemNotice(): Promise<ResultData<PlatNoticeType>> {
    return request({
        url: cloud.messageCenter + '/sysMessageCenter/mySystemNotice',
        method: 'get',
    })
}
/**
 * @description:  小铃铛平台通知
 * @return {*}
 */
export function myPlatNotice(): Promise<ResultData<PlatNoticeType>> {
    return request({
        url: cloud.messageCenter + '/sysMessageCenter/myPlatNotice',
        method: 'get',
    })
}
/**
 * @description:  全部已读
 * @return {*}
 */
export function clear(data: Partial<messageDatal>): Promise<ResultData<null>> {
    return request({
        url: cloud.messageCenter + '/sysMessageCenter/clear',
        method: 'post',
        data
    })
}
/**
 * @description:  小铃铛分页查询消息日志数据
 * @return {*}
 */
export function messagePage(params: Partial<messageDatal>): Promise<ResultData<PlatNoticeType>> {
    return request({
        url: cloud.messageCenter + '/sysMessageCenter/messagePage',
        method: 'get',
        params
    })
}
/**
 * @description:  小铃铛单条消息置为已读
 * @return {*}
 */
export function read(params: Partial<messageDatal>): Promise<ResultData<platMessageListType>> {
    return request({
        url: cloud.messageCenter + '/sysMessageCenter/read',
        method: 'get',
        params
    })
}
/**
 * @description:  平台消息一键删除
 * @return {*}
 */
export function deleteAll(data: Partial<messageDatal>): Promise<ResultData<null>> {
    return request({
        url: cloud.messageCenter + '/sysMessageCenter/deleteAll',
        method: 'post',
        data
    })
}
/**
 * @description:  小铃铛未读消息个数
 * @return {*}
 */
export function unReadMessage(): Promise<ResultData<number>> {
    return request({
        url: cloud.messageCenter + '/sysMessageCenter/unReadMessage',
        method: 'post',
    })
}
